Electronic Image Stabilization Frequency Estimator

ABSTRACT

Disclosed are a system and a method for providing electronic image stabilization (EIS). The method comprises estimating a motion frequency of an imaging device during capture of media using data received from the imaging device, comparing the estimated motion frequency of the imaging device to a baseline motion frequency threshold, and performing, in response to the estimated motion frequency meeting a first criteria based on the baseline motion frequency threshold, electronic image stabilization on the media.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/195,991, filed Nov. 20, 2018, which is a continuation of U.S.application Ser. No. 15/666,509, filed Aug. 1, 2017, now U.S. Pat. No.10,205,879, which is a continuation of U.S. application Ser. No.15/140,391, filed Apr. 27, 2016, now U.S. Pat. No. 9,756,249, all ofwhich are incorporated by reference in their entirety.

BACKGROUND Field of Art

This disclosure relates to electronic image stabilization on a camerasystem, and more specifically, to estimating motion frequency of acamera system.

Description of Art

Digital cameras are increasingly used to capture videos in a variety ofsettings, for instance outdoors or in a sports environment. Most of theoutdoor activities or sports environment involves rapid changes ofterrains or sudden changes in motion, leading to jitter within videoframes Image stabilization techniques may be used to reduce the jitterwithin frames that is associated with the motion of the camera. However,the processor resources required for stabilizing the image may depend onthe amount of changes associated with the motion of the camera. If thechange in the motion is more frequent, then a large amount of processorresources may be required for stabilizing the image. Additionally, ifthe frequency is too high, the application of image stabilizationtechnique may make the final result worse.

As users capture increasingly more and longer videos, and with limitedprocessor resources, the image stabilization becomes increasinglydifficult.

BRIEF DESCRIPTIONS OF THE DRAWINGS

The disclosed embodiments have other advantages and features which willbe more readily apparent from the following detailed description of theinvention and the appended claims, when taken in conjunction with theaccompanying drawings, in which:

Figure (or “FIG.”) 1 illustrates an example camera system for motionfrequency estimation, according to one embodiment.

FIG. 2 illustrates an example of gyroscope sample data, according to oneembodiment.

FIG. 3 illustrates an example implementation of a method for estimatingmotion frequency, according to one embodiment.

FIG. 4 illustrates an example method of electronic image stabilizationof a video frame, according to one embodiment.

FIG. 5 illustrates a flowchart of a method for determining applicationof electronic image stabilization to a video frame, according to oneembodiment.

FIG. 6 illustrates an example machine for use with a system for motionfrequency estimation, according to one embodiment.

DETAILED DESCRIPTION

The figures and the following description relate to preferredembodiments by way of illustration only. It should be noted that fromthe following discussion, alternative embodiments of the structures andmethods disclosed herein will be readily recognized as viablealternatives that may be employed without departing from the principlesof what is claimed.

Reference will now be made in detail to several embodiments, examples ofwhich are illustrated in the accompanying figures. It is noted thatwherever practicable similar or like reference numbers may be used inthe figures and may indicate similar or like functionality. The figuresdepict embodiments of the disclosed system (or method) for purposes ofillustration only. One skilled in the art will readily recognize fromthe following description that alternative embodiments of the structuresand methods illustrated herein may be employed without departing fromthe principles described herein.

Configuration Overview

Disclosed by way of example embodiments, is a system and a method fordetermining a motion frequency threshold that further determinesenabling or disabling of electronic image stabilization in real time fora video frame. An image sensor of a camera system captures a videostream that includes a plurality of frames. In some embodiments, thecamera may be mounted on a camera mount attached to a user performing asporting activity. Most of the sporting activities involve rapid changesof terrain or sudden changes in motion that make it desirable for thecamera system to capture the video stream at a high frame rate, andsimultaneously perform electronic image stabilization (EIS) for eachframe.

The sudden changes in motion may worsen the effect of EIS if acomputational delay exceeds the time period associated with the motionfrequency. Along with capturing the video stream, the system determinesavailable computational resources and determines a motion frequencythreshold based on the available resources. Simultaneously, the systemreceives data from a gyroscope that includes data related to changes inmotion from one video frame to the next. Based on the gyroscope data,the system estimates the current motion frequency pattern. The estimatedmotion frequency is compared to the determined motion frequencythreshold. If the estimated motion frequency is greater than thethreshold, EIS is not performed on the current video frame. The EISdetermination may be done on each video frame or may be done on aplurality of video frames of a video stream, thus avoiding the need tobuffer frames and post process them for motion compensation.

Example System Configuration

Turning now to Figure (FIG.) 1, illustrated is an example camera systemfor motion frequency estimation, according to one embodiment. The camerasystem 100 may include a camera body, one or more a camera lenses,various indicators on the camera body (such as LEDs, displays, and thelike), various input mechanisms (such as buttons, switches, andtouch-screen mechanisms), and electronics (e.g., imaging electronics,power electronics, metadata sensors, etc.) internal to the camera bodyfor capturing images via the one or more lenses and/or performing otherfunctions. In one embodiment, the camera 100 is capable of capturingspherical or substantially spherical content. The spherical content mayinclude still images or video having spherical or substantiallyspherical field of view. Alternatively, the camera 100 may capturesubstantially spherical images or video having less than 360 degrees inthe horizontal direction and less than 180 degrees in the verticaldirection (e.g., within 10% of the field of view associated with fullyspherical content). In other embodiments, the camera 100 may captureimages or video having a non-spherical wide angle field of view.

As described in greater detail below, the camera 100 may include sensorsto capture metadata associated with video data, such as timing data,motion data, speed data, acceleration data, altitude data, GPS data, andthe like. Additionally, the camera 100 may include processors orstabilizers to provide motion compensation by performing electronicimage stabilization.

Referring now to the details of FIG. 1, the camera 100 comprises acamera core 110 comprising a lens 112, an image sensor 114, and an imageprocessor 116. The camera 100 additionally includes a system controller120 (e.g., a microcontroller or microprocessor) that controls theoperation and functionality of the camera 100 and system memory 130configured to store executable computer instructions that, when executedby the system controller 120 and/or the image processors 116, performthe camera functionalities described herein. In some embodiments, acamera 100 may include multiple camera cores 110 to capture fields ofview in different directions which may then be stitched together to forma cohesive image. For example, in an embodiment of a spherical camerasystem, the camera 100 may include two camera cores 110 each having ahemispherical or hyper hemispherical lens that each captures ahemispherical or hyper hemispherical field of view which is stitchedtogether in post-processing to form a spherical image.

The lens 112 may be, for example, a wide angle lens, hemispherical, orhyper hemispherical lens that focuses light entering the lens to theimage sensor 114 which captures images and/or video frames. The imagesensor 114 may capture high-definition images having a resolution of,for example, 720p, 1080p, 4 k, or higher. In one embodiment, sphericalvideo is captured as a 5760 pixels by 2880 pixels with a 360 degreehorizontal field of view and a 180 degree vertical field of view. Forvideo, the image sensor 114 may capture video at frame rates of, forexample, 30 frames per second, 60 frames per second, or higher.

The image processor 116 performs one or more image processing functionsof the captured images or video. For example, the image processor 116may perform electronic image stabilization (EIS), a Bayertransformation, demosaicing, noise reduction, image sharpening, imagestabilization, rolling shutter artifact reduction, color spaceconversion, compression, or other in-camera processing functions.Processed images and video may be temporarily or persistently stored tosystem memory 130 and/or to a non-volatile storage, which may be in theform of internal storage or an external memory card.

An input/output (I/O) interface 160 transmits and receives data fromvarious external devices. For example, the I/O interface 160 mayfacilitate the receiving or transmitting video or audio informationthrough an I/O port. Examples of I/O ports or interfaces include USBports, HDMI ports, Ethernet ports, audio ports, and the like.Furthermore, embodiments of the I/O interface 160 may include wirelessports that can accommodate wireless connections. Examples of wirelessports include Bluetooth, Wireless USB, Near Field Communication (NFC),and the like. The I/O interface 160 may also include an interface tosynchronize the camera 100 with other cameras or with other externaldevices, such as a remote control, a second camera, a smartphone, aclient device, or a video server.

A control/display subsystem 170 includes various control and displaycomponents associated with operation of the camera 100 including, forexample, LED lights, a display, buttons, microphones, speakers, and thelike. The audio subsystem 150 includes, for example, one or moremicrophones and one or more audio processors to capture and processaudio data correlated with video capture. In one embodiment, the audiosubsystem 150 includes a microphone array having two or microphonesarranged to obtain directional audio signals.

Sensors 140 capture various metadata concurrently with, or separatelyfrom, video capture. For example, the sensors 140 may capturetime-stamped location information based on a global positioning system(GPS) sensor, and/or an altimeter. Other sensors 140 may be used todetect and capture orientation of the camera 100 including, for example,an orientation sensor, an accelerometer, or a magnetometer. Sensor datacaptured from the various sensors may be processed to generate othertypes of metadata.

In one embodiment, the sensors 140 may be rigidly coupled to the camera100 such that any motion, orientation or change in location experiencedby the camera 100 is also experienced by the sensors 140. The sensors140 furthermore may associates a time stamp representing when the datawas captured by each sensor. In one embodiment, the sensors 140automatically begin collecting sensor metadata when the camera 140begins recording a video.

In addition to the generic sensors, a specialized sensor may be includedsuch as the gyroscope 180. The gyroscope may be used to generate motionmetadata, comprising velocity representative of motion of the camera100, acceleration vectors may be derived from the motion metadatareceived from the gyroscope. The gyroscope sensor data may includesensing vibrations on the camera produced by external factors that ismeasured along three axes representing three directions. The gyroscopedata is discussed in detail below with respect to FIG. 2. The gyroscopesensor data is transmitted by the sensors to the image processor 116 forprocessing the image/video frame.

FIG. 2 illustrates an example of gyroscope sample data, according to oneembodiment. The image sensor 114 captures an image/video frame.Simultaneously, the gyroscope 180 gathers motion data along three axes,i.e. a pitch (lateral) axis, a roll (longitudinal) axis and a yaw(perpendicular) axis. The three axes represent the angles of rotation ofthe camera in three dimensions about the camera's center of gravity.

The illustrated graph of FIG. 2 shows gyroscope data collected for theyaw axis. The frequency of rotation of each dimension is different fromeach other. The X-axis of the gyroscope data represents time and theY-axis represents the displacement in degrees per second. A positivedisplacement 204 (e.g., the motion is measured as positive degrees persecond) indicates that the camera (or any other object) attached to thegyroscope is moving the left relative to its previous position. Anegative displacement 206 (e.g., the motion is measured as negativedegrees per second) indicates that the camera is moving to the rightrelative to its previous position. Furthermore, an increasingdisplacement indicates that the motion is accelerating to the left ordecelerating to the right, while a decreasing displacement indicatesthat the motion is decelerating to the left or accelerating to theright. A displacement of zero or a small displacement within a noisemargin 202 indicates that the camera is not moving or has a very smallmotion within the noise margin 202.

The amount of displacement is indicated as a measure of degrees persecond. For example, the spike in the upward direction 204 shows adisplacement of about 11 degrees per second to the left on the yaw axisat its peak velocity. The spike in the downward direction 206 shows adisplacement of around 9 degrees per second to the right on the yaw axisat its peak velocity. A sinusoidal pattern of the gyroscope datarepresents frequent motion changes indicating an oscillating left andright movement. In one embodiment, a frequency of the motion iscalculated based on the time period of each sinusoid of the yaw axis,for example, 1 Hz motion frequency 208 calculated based on a time periodof 1000 milliseconds measured for an oscillation cycle on the yaw axis,representing a motion to the right and back to the left.

Motion Frequency Estimation

FIG. 3 illustrates an example implementation of a method for estimatingmotion frequency, according to one embodiment. The example showsgyroscope data for three video frames. The Y-axis primarily representsthree regions, a noise threshold region 302, a positive displacementregion 304 and a negative displacement region 306. In the noisethreshold region 302, the camera is generally stable and not moving withhigh velocity. In the positive displacement region 304, the gyroscopedata shows that the camera is moving to the left. In the negativedisplacement region 306, the gyroscope data shows that the camera ismoving to the right.

For each video frame, the number of polarity changes 308 in the detectedmotion is determined. In this context, a polarity change is a transitionfrom a positive displacement region 304 to a negative displacementregion 306 or vice versa that crosses the noise threshold region 302. Apolarity change is also counted at the beginning of each frame, in oneembodiment. For example, in the illustrated data, 3 polarity changes aredetected for frame one, 4 polarity changes for frame two and 3 polaritychanges for frame three. A total number of polarity changes arecalculated for a preconfigured number of frames. For example, in theillustrated graph, 10 polarity changes are counted over three frames.The motion frequency is estimated based on the total number of polaritychanges over the time period of the total number of frames. For example,in the illustrated graph, 10 polarity changes occur in 100 milliseconds,which correspond to approximately 100 polarity changes in a second. Thisestimates a motion frequency of approximately 50 Hz.

In one embodiment, the preconfigured number of frames over which thefrequency is estimated may be included in a sliding window. In a slidingwindow, there is a partial overlap of frames used in each successivefrequency estimate. The number of polarity changes for a given windowmay be to estimate the frequency of the last frame in the window.Alternatively, the estimated motion frequency for a given window may beused as the estimate for the center frame of the window. In cases wherea sliding window is used, the total number of polarity changes of eachframe may be propagated forward, thus reducing the needed buffer space.For example, to estimate the motion frequency associated with frame n,the number of polarity changes in frames n−2 through n are used. Thecounts for each frame are also stored in a buffer. Next, to estimate themotion frequency associated with the frame n+1, the number of polaritychanges in frames n−1 through n+1 are used, and so on. Here, the numberof polarity changes in frame n+1 are counted. The counts for frames n−1and n may be already stored in the buffer and can be read from thebuffer to perform the frequency estimation. Furthermore, the count forframe n+1 may be stored to the buffer replacing the oldest value in thebuffer (e.g., the count from frame n−2). In this way, a limited sizebuffer may be used and counts need not be re-performed for every frameof the window.

A high motion frequency may cause significant performance degradationand affect the image/video frame quality, such as jitter within framesand other such degradation. An image processor performs electronic imagestabilization (EIS) techniques to reduce the jitter within frames, thejitter associated with the motion frequency.

FIG. 4 illustrates an example capture window and view window used forelectronic image stabilization of a video frame, according to oneembodiment. An image processor captures a video frame in a capturewindow 402 that is greater than an output view window 404. For example,the capture window is 3840×2160 pixels and the output view window is2000×1128 pixels. Based on the motion data analyzed from the gyroscopefor a given frame relative to a reference frame, the output view windowis adjusted within the capture window to compensate for the cameramotion between the reference frame and the given frame. For example, ifthe gyroscope data indicates motion to the right by x pixels, the outputview window is moved to the left by x pixels or vice versa to compensatefor the motion. Thus stationary objects in the scene may appearstationary despite the camera movement.

In one embodiment, the EIS is one of a plurality of tasks performed byan image processor. Each task accesses shared resources such as memory,processor, signal processor, etc. The EIS competes with the plurality ofother tasks to access these shared resources. This may lead tocomputational delays when performing the EIS task. If the computationaldelay for processing the EIS exceeds a frame rate by less than a timeperiod, the EIS compensation may worsen the jitter effect, leading toperformance degradation rather than an improvement. The frame rate maybe derived from the motion frequency pattern 208 as described earlierwith respect to FIG. 2. Thus, if the EIS is not performed in apre-configured period of time, the result of applying EIS to the videoframe may be worse than not applying EIS at all. Hence for each videoframe, a determination is made to enable or disable application of EISbased on the motion frequency determined from the gyroscope data and thecomputational load of the image processor. When EIS is enabled for agiven frame, the view window 404 may be adjusted within the capturewindow 406 to compensate for the detected motion of the camera betweenthe given frame and a reference frame. In contrast, when EIS is disabledfor a given frame, the view window 404 is not adjusted and remains at adefault position (e.g., centered or in the same location as the previousframe).

FIG. 5 illustrates a flowchart of a method for controlling electronicimage stabilization, according to one embodiment. An image sensor of acamera system captures 505 a video stream that includes a plurality ofvideo frames. An image processor determines 510 availability ofcomputational resources such as memory, processing unit, signalprocessor time, etc. on the camera system by measuring the current loadon the system. The current load may be determined in a number of wayssuch as determining the number of tasks being performed, resources beingused by each task, the number of tasks waiting in queue for resourceavailability and the like. The image processor simultaneously receives515 motion data for each axis from the gyroscope.

Based on the availability of computational resources, a motion frequencythreshold is determined 520. For example, if the video frame rate is lowand there are about two tasks running that need a few cycles of theprocessor, the motion frequency threshold is set to a relatively highthreshold value. Alternatively, if the video frame rate is high andthere are tasks running on each thread of the processor and few taskswaiting in the pipeline/queue, the motion frequency threshold is set toa relatively low threshold value. A motion frequency of each video frameis estimated 525 in parallel from the gyroscope data by the methoddescribed with respect to FIG. 3.

The estimated motion frequency is compared 535 to the determined motionfrequency threshold. In one embodiment, if the estimated motionfrequency is greater than the motion frequency threshold, it is highlylikely that applying EIS to the video frame may worsen the jitter withinvideo frames due to a computational delay and hence EIS is disabled 545.If the estimated motion frequency is less than or equal to the motionfrequency threshold, EIS is enabled 540 and applied to the video frame.The EIS may be disabled or enabled using a switching element such as atoggle switch, a switching flag that can be set to 1 for enabling and 0for disabling or any other such switching element.

In the above embodiment, if the estimated motion frequency is within ashort range around the motion frequency threshold, the estimated motionfrequency may frequently switch between being above or below the motionthreshold. To avoid a resultant frequent switching of the EIS on andoff, in an alternate embodiment, two motion frequency thresholds aredetermined for each frame, a lower motion frequency threshold and anupper motion frequency threshold. For example, the lower motionfrequency threshold may be at a 10% lower frequency than the determinedbaseline motion frequency threshold and an upper motion frequencythreshold may be at a 10% higher frequency than the determined baselinemotion frequency threshold. Application of EIS is enabled if theestimated motion frequency is below or equal to the lower motionfrequency threshold and EIS is disabled if the estimated motionfrequency is higher than the upper motion frequency threshold. When theestimated motion frequency is between the lower and upper thresholds,the EIS enabled/disabled state remains the same as in the previousframe.

In another embodiment, to avoid the rapid switching, a tapering motionfrequency threshold may be applied. A tapering motion frequencythreshold is configured to be at a certain percentage of the determinedmotion frequency threshold, for example 50% of the determined baselinemotion frequency. If the estimated motion frequency is below or equal tothe tapering motion frequency threshold, EIS is enabled and a 100% EISis applied to the video frame. If the estimated motion frequency isgreater than the determined baseline motion frequency threshold, EIS isdisabled and not applied to the video frame. If the estimated motionfrequency is between the tapering motion frequency threshold and thedetermined baseline motion frequency threshold, EIS is enabled and apartial EIS is applied to the video frame. The EIS level here isdetermined as a percentage of the shift that would be applied to fullystabilize the frame. Furthermore, the EIS level may vary inversely tothe estimated motion frequency within the range between the taperingmotion frequency threshold and the determined baseline motion frequencythreshold. For example 90% EIS may be applied when an estimated motionfrequency is 10% above the tapering motion frequency threshold.

In an illustrative example, the baseline motion frequency threshold isdetermined to be at 100 Hz, and the tapering motion frequency thresholdis configured at 50 Hz. For a given frame, it is determined that theframe moved to the camera moved 100 pixels to the right relative to areference frame. When the estimated motion frequency is at 40 Hz (belowthe tapering motion frequency threshold), 100% EIS is applied. Thus, inthis example, the view window is moved to the left by 100 pixels in thecapture window to fully stabilize the frame. When the estimated motionfrequency is at 60 Hz (above the tapering motion frequency threshold butbelow the baseline motion frequency threshold), 80% of EIS is applied.Thus, the view window is moved to the left by 80 pixels instead of 100pixels in the capture window, only partially stabilizing the frame. Theamount of applied EIS decreases (e.g., linearly or non-linearly) as theestimated motion frequency progresses closer to the determined motionfrequency threshold.

Computing Machine Architecture

FIG. 6 is a block diagram illustrating components of an example machineable to read instructions from a machine-readable medium and executethem in a processor (or controller). Specifically, FIG. 6 shows adiagrammatic representation of a machine in the example form of acomputer system 600 within which instructions 624 (e.g., software) forcausing the machine to perform any one or more of the methodologiesdiscussed herein may be executed. In alternative embodiments, themachine operates as a standalone device or may be connected (e.g.,networked) to other machines. In a networked deployment, the machine mayoperate in the capacity of a server machine or a client machine in aserver-client network environment, or as a peer machine in apeer-to-peer (or distributed) network environment.

The machine may be a server computer, a client computer, a personalcomputer (PC), a tablet PC, a set-top box (STB), a personal digitalassistant (PDA), a cellular telephone, a smartphone, a web appliance, anetwork router, switch or bridge, or any machine capable of executinginstructions 624 (sequential or otherwise) that specify actions to betaken by that machine. Further, while only a single machine isillustrated, the term “machine” shall also be taken to include anycollection of machines that individually or jointly execute instructions624 to perform any one or more of the methodologies discussed herein.For example, the computer system 600 may be used to determine enablingor disabling of electronic image stabilization as described by theprocesses of FIGS. 2-5.

Looking closer at the example computer system 600, it includes one ormore processors 602 (generally processor 602) (e.g., a centralprocessing unit (CPU), a graphics processing unit (GPU), a digitalsignal processor (DSP), one or more application specific integratedcircuits (ASICs), one or more radio-frequency integrated circuits(RFICs), or any combination of these), a main memory 604, and a staticmemory 606, which are configured to communicate with each other via abus 608. The computer system 600 may further include graphics displayunit 610 (e.g., a plasma display panel (PDP), a liquid crystal display(LCD), a projector, or a cathode ray tube (CRT)). The computer system600 may also include alphanumeric input device 612 (e.g., a keyboard), acursor control device 614 (e.g., a mouse, a trackball, a joystick, amotion sensor, or other pointing instrument), a storage unit 616, asignal generation device 618 (e.g., a speaker), and a network interfacedevice 620, which also are configured to communicate via the bus 808.

The storage unit 616 includes a machine-readable medium 622 on which isstored instructions 624 (e.g., software) embodying any one or more ofthe methodologies or functions described herein. The instructions 624(e.g., software) may also reside, completely or at least partially,within the main memory 604 or within the processor 602 (e.g., within aprocessor's cache memory) during execution thereof by the computersystem 600, the main memory 604 and the processor 602 also constitutingmachine-readable media. The instructions 624 (e.g., software) may betransmitted or received over a network 626 via the network interfacedevice 620.

While machine-readable medium 622 is shown in an example embodiment tobe a single medium, the term “machine-readable medium” should be takento include a single medium or multiple media (e.g., a centralized ordistributed database, or associated caches and servers) able to storeinstructions (e.g., instructions 624). The term “machine-readablemedium” shall also be taken to include any medium that is capable ofstoring instructions (e.g., instructions 624) for execution by themachine and that cause the machine to perform any one or more of themethodologies disclosed herein. The term “machine-readable medium”includes, but not be limited to, data repositories in the form ofsolid-state memories, optical media, and magnetic media. It is notedthat the instructions 624 may correspond to the processes of estimatingmotion frequency and determining application of EIS to a video frame asdescribed in FIGS. 3-6.

Additional Configuration Considerations

Throughout this specification, some embodiments have used the expression“coupled” along with its derivatives. The term “coupled” as used hereinis not necessarily limited to two or more elements being in directphysical or electrical contact. Rather, the term “coupled” may alsoencompass two or more elements are not in direct contact with eachother, but yet still co-operate or interact with each other, or arestructured to provide a thermal conduction path between the elements.

Likewise, as used herein, the terms “comprises,” “comprising,”“includes,” “including,” “has,” “having” or any other variation thereof,are intended to cover a non-exclusive inclusion. For example, a process,method, article, or apparatus that comprises a list of elements is notnecessarily limited to only those elements but may include otherelements not expressly listed or inherent to such process, method,article, or apparatus.

In addition, use of the “a” or “an” are employed to describe elementsand components of the embodiments herein. This is done merely forconvenience and to give a general sense of the invention. Thisdescription should be read to include one or at least one and thesingular also includes the plural unless it is obvious that it is meantotherwise.

Finally, as used herein any reference to “one embodiment” or “anembodiment” means that a particular element, feature, structure, orcharacteristic described in connection with the embodiment is includedin at least one embodiment. The appearances of the phrase “in oneembodiment” in various places in the specification are not necessarilyall referring to the same embodiment.

Upon reading this disclosure, those of skill in the art will appreciatestill additional alternative structural and functional designs for thedisclosed embodiments as disclosed from the principles herein. Thus,while particular embodiments and applications have been illustrated anddescribed, it is to be understood that the disclosed embodiments are notlimited to the precise construction and components disclosed herein.Various modifications, changes and variations, which will be apparent tothose, skilled in the art, may be made in the arrangement, operation anddetails of the method and apparatus disclosed herein without departingfrom the spirit and scope defined in the appended claims.

What is claimed is:
 1. A method, comprising: estimating motion of animaging device during capture of media using data received from theimaging device; and in response to the motion meeting a first criteriabased on a comparison with a motion threshold, performing electronicimage stabilization on the media.
 2. The method of claim 1, wherein thedata is received from a gyroscope of the imaging device and includessensed motion of the imaging device.
 3. The method of claim 2, whereinthe data includes positive displacement and a negative displacement, thepositive displacement indicating movement in a first direction, thenegative displacement indicating movement in a second direction oppositethe first direction.
 4. The method of claim 3, further comprising:determining a number of polarity changes in the sensed motion, thenumber of polarity changes indicating any of a change in motion from thefirst direction to the second direction and a change in motion from thesecond direction to the first direction.
 5. The method of claim 1,wherein the media comprises a video stream with a plurality of videoframes, and wherein estimating the motion of the imaging device furthercomprises: determining, for each video frame of the video stream, anumber of polarity changes in the data indicating any of a change from amotion in a first direction that exceeds a first noise threshold to amotion in a second direction that exceeds a second noise threshold and achange from the motion in the second direction that exceeds the secondnoise threshold to the motion in the first direction that exceeds thefirst noise threshold; determining a total number of polarity changesover a window of video frames of the video stream; determining a totaltime of capture of the window of the video frames; and estimating amotion frequency based on the total number of polarity changes and thetotal time of capture.
 6. The method of claim 1, wherein the mediacomprises a video stream with a plurality of video frames, and whereinestimating the motion of the imaging device further comprises:estimating a motion frequency on a sliding window of the plurality ofvideo frames.
 7. The method of claim 1, further comprising: determininga lower motion threshold below the motion threshold and an upper motionthreshold above the motion threshold; and determining that the motionmeets the first criteria if the motion is below the lower motionthreshold and determining that the motion meets a second criteria if themotion is above the upper motion threshold.
 8. The method of claim 7,further comprising: determining that the motion meets the first criteriaif the motion is above the lower motion threshold and below the uppermotion threshold and if a last motion met the first criteria; anddetermining that the motion meets the second criteria if the motion isabove the lower motion threshold and below the upper motion thresholdand if the last motion met the second criteria.
 9. The method of claim1, further comprising: determining a tapering motion threshold based onthe motion threshold; determining that the motion meets the firstcriteria if the motion is below the tapering motion threshold,determining that the motion meets a second criteria if the motion isabove the motion threshold, and determining that the motion meets athird criteria if the motion is between the tapering motion thresholdand the motion threshold; and in response to the motion meeting thethird criteria, performing a partial electronic image stabilization onthe media, a stabilization level of the partial electronic imagestabilization varying inversely to the motion.
 10. A non-transitorycomputer readable storage medium configured to store instructions, theinstructions when executed by a processor cause the processor to:determine motion of a device during capture of media using data;determine that the motion meets a first criteria based on a motionthreshold; and perform electronic image stabilization on the media. 11.The non-transitory computer readable storage medium of claim 10, whereinthe instructions further cause the processor to: receive the data from agyroscope of the device, the data including any of sensed motion of thedevice, a positive displacement, and a negative displacement, thepositive displacement indicating movement in a first direction and thenegative displacement indicating movement in a second direction.
 12. Thenon-transitory computer readable storage medium of claim 11, wherein theinstructions further cause the processor to: determine a number ofpolarity changes in the sensed motion, the number of polarity changesindicating any of a change in motion from the first direction to thesecond direction and a change in motion from the second direction to thefirst direction.
 13. The non-transitory computer readable storage mediumof claim 10, wherein the media comprises a video stream with a pluralityof video frames, and wherein to determine the motion further comprisesto: determine, for each video frame of the video stream, a number ofpolarity changes in the data indicating any of a change from a motion ina first direction that exceeds a first noise threshold to a motion in asecond direction that exceeds a second noise threshold and a change fromthe motion in the second direction that exceeds the second noisethreshold to the motion in the first direction that exceeds the firstnoise threshold; determine a total number of polarity changes over awindow of video frames of the video stream; determine a total time ofcapture of the window of the video frames; and estimate a motionfrequency based on the total number of polarity changes and the totaltime of capture.
 14. The non-transitory computer readable storage mediumof claim 10, wherein the instructions further cause the processor to:determine a lower motion threshold below the motion threshold and anupper motion threshold above the motion threshold; and determine thatthe motion meets the first criteria if the motion is below the lowermotion threshold and determine that the motion meets a second criteriaif the motion is above the upper motion threshold.
 15. A camera device,comprising: a processor; and a memory storing an application that whenexecuted by the processor causes the processor to: estimate a motionfrequency of the camera device during capture of media; compare themotion frequency of the camera device to a motion frequency threshold;and in response to the motion frequency meeting a first criteria basedon the motion frequency threshold, perform electronic imagestabilization on the media.
 16. The camera device of claim 15, furthercomprising: a gyroscope configured to detect data, the data being usedto estimate the motion frequency and including any of sensed motion ofthe camera device, a positive displacement, and a negative displacement,the positive displacement indicating movement in a first direction andthe negative displacement indicating movement in a second directionopposite the first direction.
 17. The camera device of claim 16, whereinthe application when executed further causes the processor to: determinea number of polarity changes in the sensed motion, the number ofpolarity changes indicating any of a change in motion from the firstdirection to the second direction and a change in motion from the seconddirection to the first direction.
 18. The camera device of claim 16,wherein the media comprises a plurality of video frames, and wherein toestimate the motion frequency further comprises to: determining, foreach video frame, a number of polarity changes in the data indicatingany of a change from a motion in a first direction that exceeds a firstnoise threshold to a motion in a second direction that exceeds a secondnoise threshold and a change from the motion in the second directionthat exceeds the second noise threshold to the motion in the firstdirection that exceeds the first noise threshold; determining a totalnumber of polarity changes over a window of video frames; determining atotal time of capture of the window of video frames; and estimating themotion frequency based on the total number of polarity changes and thetotal time of capture.
 19. The camera device of claim 15, wherein themedia comprises a plurality of video frames, and wherein to estimate themotion frequency further comprises to: estimate the motion frequency ona sliding window of the plurality of video frames.
 20. The camera deviceof claim 15, wherein the application when executed further causes theprocessor to: determine a lower motion frequency threshold below themotion frequency threshold and an upper motion frequency threshold abovethe motion frequency threshold; and determine that the motion frequencymeets the first criteria if the motion frequency is below the lowermotion frequency threshold and determine that the motion frequency meetsa second criteria if the motion frequency is above the upper motionfrequency threshold.